<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <script src="https://how2j.cn/study/js/jquery/2.0.0/jquery.min.js"></script>
    <link href="https://how2j.cn/study/css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="https://how2j.cn/study/js/bootstrap/3.3.6/bootstrap.min.js"></script>
    <script src="https://how2j.cn/study/vue.min.js"></script>
    <script src="https://how2j.cn/study/axios.min.js"></script>
</head>
        <body>
               <div id="div1">
                   <a class="btn btn-info" href="add.html">添加</a>
                   <h1>个人企业招聘信息列表</h1>
                   <table class="table table-bordered" >
                       <thead>
                       <th>用户名</th>
                       <th>公司名称</th>
                       <th>行业</th>
                       <th>职位名称</th>
                       <th>教育等级</th>
                       <th>薪水</th>
                       <th>创建时间</th>
                       <th>有效时间</th>
                       <th>工作详情</th>
                       <th>操作</th>
                       </thead>
                       <tbody>
                       <tr v-for="data in list">
                           <td>{{data.name}}</td>
                           <td>{{data.companyName}}</td>
                           <td>{{data.industry}}</td>
                           <td>{{data.jobName}}</td>
                           <td>{{data.education}}</td>
                           <td>{{data.salary}}</td>
                           <td>{{data.createTime}}</td>
                           <td>{{data.effectiveTime}}</td>
                           <td>{{data.jobDetails}}</td>
                           <td><a class="btn btn-danger" @click="updateRecruit(data.id)">修改</a></td>
                           <td><a class="btn btn-danger" @click="deleteRecruit(data.id)">删除</a></td>
                       </tr>
                       </tbody>
                   </table>
                   <h1>求职信息列表</h1>
                   <table class="table table-bordered" >
                       <thead>
                       <th>名字</th>
                       <th>行业</th>
                       <th>工作名称</th>
                       <th>工资</th>
                       <th>创建时间</th>
                       <th>有效时间</th>
                       <th>操作</th>
                       </thead>
                       <tbody>
                       <tr v-for="data in list1">
                           <td>{{data.name}}</td>
                           <td>{{data.industry}}</td>
                           <td>{{data.productName}}</td>
                           <td>{{data.salary}}</td>
                           <td>{{data.createTime}}</td>
                           <td>{{data.effectiveTime}}</td>
                           <td ><button class="btn btn-danger" @click="findResume(data.resumeId)">查看简历</button></td>
                       </tr>
                       </tbody>
                   </table>
               </div>

        </body>


        <script>

            new Vue({
                el:'#div1',
                data:{
                    list:[],
                    list1:[]
                },
                mounted:function(){ //mounted　表示这个 Vue 对象加载成功了
                    var self = this
                    axios.get("/company/recruitList").then(function(response) {
                        self.list= response.data;
                    })
                    axios.get("/company/studentJobList").then(function(response) {
                        self.list1= response.data;
                    })
                },
                methods:{
                    findResume(resumeId){
                        window.location.href="/static/other/company/company/resumeInfo.html?resumeId="+resumeId;
                    },
                    updateRecruit(id){
                        window.location.href="updateRecruit.html?id="+id;
                    },
                    deleteRecruit(id){
                        window.location.href="/company/deleteRecruit?id="+id;
                    }
                }
            })

        </script>
</html>
